package me.itsoo.artemis.framework.core.tuple;

import lombok.Data;

/**
 * TrimedStringPair
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/5/10
 */
@Data
@SuppressWarnings("all")
public class TrimedStringPair implements Pair<String, String> {

    private static final TrimedStringPair EMPTY = new TrimedStringPair();

    private String key;

    private String value;

    public static TrimedStringPair create(String key, String value) {
        final TrimedStringPair result = new TrimedStringPair();
        result.setKey(key);
        result.setValue(value);
        return result;
    }

    public static TrimedStringPair empty() {
        return EMPTY;
    }

    @Override
    public String getKey() {
        return (this.key == null) ? null : this.key.trim();
    }

    @Override
    public String getValue() {
        return (this.value == null) ? null : this.value.trim();
    }
}
